/**
*
* 2007-11-5 下午08:14:41
* @author xuhuan
*/

package edu.ccut.saturn.studio.wfg.policy;

import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.DirectEditPolicy;
import org.eclipse.gef.requests.DirectEditRequest;

import edu.ccut.saturn.studio.wfg.command.RenameCommand;
import edu.ccut.saturn.studio.wfg.model.Shape;

public class SaturnDirectEditPolicy extends DirectEditPolicy {

	@Override
	protected Command getDirectEditCommand(DirectEditRequest request) {
		  RenameCommand cmd = new RenameCommand();
	        cmd.setShape((Shape) getHost().getModel());
	        cmd.setName((String) request.getCellEditor().getValue());
	        return cmd;
		
	}

	@Override
	protected void showCurrentEditValue(DirectEditRequest request) {
	}
}
